package com.example.mybatisplusdemo.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.mybatisplusdemo.model.domain.AuditMessage;
import com.example.mybatisplusdemo.mapper.AuditMessageMapper;
import com.example.mybatisplusdemo.model.dto.PageDTO;
import com.example.mybatisplusdemo.model.vo.AuditMessageVO;
import com.example.mybatisplusdemo.service.IAuditMessageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author lxp
 * @since 2025-07-05
 */
@Service
public class AuditMessageServiceImpl extends ServiceImpl<AuditMessageMapper, AuditMessage> implements IAuditMessageService {

    @Autowired
    private final AuditMessageMapper auditMessageMapper;

    public AuditMessageServiceImpl(AuditMessageMapper auditMessageMapper) {
        this.auditMessageMapper = auditMessageMapper;
    }

    @Override
    public Page<AuditMessageVO> listPagingAuditMessagesByMerchantIdWithStoreInfo(PageDTO pageDTO, Long merchantId) {
        Page<AuditMessageVO> page = new Page<>(pageDTO.getPageNo(), pageDTO.getPageSize());
        page = auditMessageMapper.listPagingAuditMessagesByMerchantIdWithStoreInfo(page, merchantId);
        return page;
    }
}
